cl <- makeCluster(getOption("cl.cores", 2))
clusterEvalQ(cl, source("C:/UQAR/Recherche/Maitrise/Donnees/R/DataManagement/loadData.R"))


system.time({
						error <- parLapply(cl, mobile.data, getError)
		})

length(mobile.data)

md1 <- mobile.data[1:10]
md2 <- mobile.data[1:20]

system.time({
			error3 <- mclapply(mobile.data, getError)
		})

system.time({
			error3 <- mclapply(list(md1,md2), getError)
		})

system.time({
			error2 <- lapply(mobile.data, getError)
		})


clusterCall(ARGOS_CLUSTER, mean, c(3,2,3))


DT = data.table(x=rep(c("a","b","c"),each=2), y=c(1,3), v=1:6)
setkey(DT, y)

DT[,print(.BY),by=y]

DT2= data.table(x=rep(c("d","e","f"),each=2), y=c(1,3), v=5:10)

DT[, tt(.BY[[1]]),by=y]

tt <- function(x) {
	str(x[[1]])
	print(x)
}